<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{$Think.config.site.title} - 客户余额退款</title>
    <meta name="keywords" content="{$Think.config.site.keywords}">
    <meta name="description" content="{$Think.config.site.description}">
    <link href="{$Think.config.site.resource_url}css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/plugins/iCheck/custom.css" rel="stylesheet">
    <!-- Data Tables -->
    <link href="{$Think.config.site.resource_url}css/animate.css" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/style.css?v=4.1.0" rel="stylesheet">
</head>
<style>
    .fa{ color:#1ab394;  cursor:pointer;}

</style>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>{:lang('客户押金金额设置')}</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                    <form method="post" class="form-horizontal" action="" id="updateUser" >
                        <input type="hidden" name="id" value="{$v['id'] ?? ''}" />
                        <div class="form-group">
                            <label class="col-sm-2 control-label">{:lang('用户名')}</label>
                            <div class="col-sm-10">
                                <input  class="form-control" type="text" value="{$v['name'] ?? ''}" readOnly="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label" >{:lang('电话')}</label>
                            <div class="col-sm-10">
                                <input  class="form-control" type="text" value="{$v['mobile'] ?? ''}" readOnly="true">

                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">{:lang('当前余额')}</label>
                            <div class="col-sm-10">
                                <input  class="form-control" type="text" value="{$v['balance'] ?? ''}" readOnly="true" disabled="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">{:lang('押金')}</label>
                            <div class="col-sm-10">
                                <input id="deposit" name="deposit" class="form-control" type="number" step="0.01" value="{$v['deposit'] ?? ''}" >
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-2">

                                <input type="button" class="btn btn-primary" value="{:lang('提交')}" id="update">

                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="{$Think.config.site.resource_url}js/jquery.min.js?v=2.1.4"></script>
<script src="{$Think.config.site.resource_url}js/bootstrap.min.js?v=3.3.5"></script>
<script src="{$Think.config.site.resource_url}js/content.min.js?v=1.0.0"></script>
<script src="{$Think.config.site.resource_url}js/plugins/validate/jquery.validate.min.js"></script>
<script src="{$Think.config.site.resource_url}js/plugins/validate/messages_zh.min.js"></script>
<script src="{$Think.config.site.resource_url}js/plugins/layer/layer.js"></script>
<script type="text/javascript">
    $(function(){
        //更新信息
        $("#update").click(function(){
            var fomrData = $("#updateUser").serialize();
            var action = 'deposit';
            $.ajax({
                type: "post",
                url : '<?php echo \think\Request::instance()->root(); ?>/<?php echo \think\Request::instance()->module(); ?>/Customer/'+action,
                dataType : 'json',
                data : fomrData,
                success: function(result){
                    if(0 === result.code) {
                        layer.msg(result.msg, {icon: 1});
                        parent.location.reload();
                    }else{
                        layer.msg(result.msg, {icon: 5});
                    }
                },
                error : function(){
                    layer.msg("{:lang('服务器错误！请稍后重试')}", {icon: 2});
                }

            });
        });

        //点击退款押金

    });
</script>
</body>
</html>